#include "xml.h"
#include "jadro.h"
#include "q_io.h"
#include "synt_an.h"
#include "beh.h"
#include "qconst.h"

void Qvstup::exportXml(FILE* f) {
	QFILE << "<?xml version=\"1.0\"?>\n<Graphs>\n";
	exportXml2(f);
	QFILE << "</Graphs>\n";
}

void Qvstup::exportXml2(FILE* f) {
	if(vhrana()) vhrana()->exportXml(f);
  	if(dalsi())
  	{
    		//QFILE << endln;
    		dalsi()->exportXml2(f);
  	}
}

void Qhrana::exportXml(FILE* f) {
	QFILE << "<Graph>\n";
	test2(f, 1, 1);
	QFILE << "</Graph>\n";
}

void Qstrom::exportXml(FILE* f) {
	QFILE << "<Tree>\n<Linearized>";
	test3(f);
	QFILE << "</Linearized>\n";
	testXml(f);
	QFILE << "</Tree>\n";
}
